<%@ page import="com.xv.yan.beans.res.TableResult" %>
<%@ page import="com.xv.yan.beans.entity.StudentDo" %>
<%@ page import="java.util.List" %>
<%@ page import="com.xv.yan.beans.vo.StudentVo" %><%--
  Created by IntelliJ IDEA.
  User: a
  Date: 2022/1/11
  Time: 16:30
  To change this template use File | Settings | File Templates.
--%>



<%--
他这些都没有改，只改了刚才那几处，我是所有存在  代码是灵活的    没必要跟他完全一样    那几个分页查询 就麻烦了   代码冗杂
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生管理-学生成绩管理系统-javaweb实战</title>
    <style>
        table{
            border-collapse: collapse;
            border-spacing: 0;
            border: 1px solid black;
        }
        tr{
            line-height: 2;
        }
        th,td{
            border: 1px solid black;
            padding: 0 10px;
        }
        #container{
            text-align: left;
            margin-left: 560px;
            margin-top: 50px;
            line-height: 1.5;
        }
        .nav,.search,.page{
            line-height: 2;
        }
    </style>

</head>
<body>
<div style="margin-top: 100px">
    <jsp:include page="../top.jsp"/>
    <div id="container">
        <section class="nav">
            <a href="#">学生管理</a>
            <a href="#">成绩管理</a>
        </section>
        <section class="search">
            <%
                TableResult<StudentVo> tableResult=(TableResult) request.getAttribute("tableResult");
            %>
            <a href="<%=request.getContextPath()%>/StudentServlet?type=toAdd">新增学生</a>
            <form method="post" action="<%=request.getContextPath()%>/StudentServlet?type=toStudentManage">
                <input type="text" name="studentName" value="<%= tableResult.getStudentName()%>"/>
                <input type="submit" value="查询"/>
            </form>
        </section>
        <section>
            <table>
                <thead>
                <tr>
                    <th>编号</th>
                    <th>学生姓名</th>
                    <th>学号</th>
                    <th>生日</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <%
                    List<StudentVo> date=tableResult.getDate();
                    for (int i=0;i<date.size();i++){
                        StudentVo studentVo=date.get(i);
                %>
                <tr>
                    <td><%= studentVo.getId()%></td>
                    <td><%= studentVo.getStudentName()%></td>
                    <td><%= studentVo.getNo()%></td>
                    <td><%= studentVo.getBirthDay()%></td>
                    <td>操作</td>
                </tr>
                <%
                    }
                %>

                </tbody>
            </table>
            <div class="page">
                <a href="#">首页</a>
                <a href="#">上一页</a>
                <a href="#">下一页</a>
                <a href="#">尾页</a>
                <span>共xx页</span>
                <span>,共xx条</span>
                <span>,当前是xx页</span>
            </div>
        </section>

    </div>
<jsp:include page="../bottom.jsp"/>
</div>
</body>
</html>
